package com.bjpowerrnode.javase.interger;

public class IntegerTest08 {
    public static void main(String[] args) {

        int i = 100;

        //int --> String
        //方法1
        String s = i + "";
        //方法2
        String s1 = String.valueOf(i);

        //String --> int
        int i0 = Integer.parseInt("123");

        //int --> Integer (装箱)
        Integer i1 = Integer.valueOf(100);
        Integer i2 = Integer.valueOf(100);

        //Integer --> int(拆箱)
        int i4 = i1.intValue();
        float f0 = i2.floatValue();


        //String --> integer
        Integer SI = Integer.valueOf("123");

        //integer --> String
        String IS = String.valueOf(SI);


        //String --> int
        String ss1 = "100";
       int si1 =  Integer.parseInt(ss1);
        System.out.println(si1 + 1);//101

        //int --> String
        String ss2 = si1 + "";//100字符串
        System.out.println(ss2 + 1);//1001

        //int --> Integer
        //自动装箱
        Integer integer0 = 1000;
        //Integer.valueOf()方法
        Integer integer1 = Integer.valueOf(1000);

        //integer --> int
        //自动拆箱
        int int0 = integer0;
        //intValue()方法
        int int1 = integer0.intValue();
        System.out.println("=======");
        System.out.println(int1 + 10);

        //String --> Integer
        Integer integer3 = Integer.valueOf("123");

        //integer --> String
        String string3 = String.valueOf(integer3);
        System.out.println(string3 + 1);//1231




    }
}
